home *** CD-ROM | disk | FTP | other *** search
- Path: icg.resnet.upenn.edu!konrad
- From: konrad@icg.resnet.upenn.edu (Konrad Hernblad)
- Newsgroups: comp.lang.c
- Subject: help w/ scanf not recognizing ESC or \n
- Date: 22 Jan 1996 01:52:37 GMT
- Organization: Internet Consultants Group
- Message-ID: <4duql5$rg@netnews.upenn.edu>
- NNTP-Posting-Host: icg.resnet.upenn.edu
- X-Newsreader: TIN [version 1.2 PL2]
-
- if i ask a user to enter a string and accept the value into a variable,
- say 'name', using scanf("%s", name);, is there a way to tell if the first
- key (i.e. name[0]) pressed is ESC or return? if the first key is ESC or
- \n, i want to call another function. i can do it using getch(), but i
- need to use scanf() because getch() records every keystroke and i don't
- want it to record when the user presses the backspace key or the
- right/left arrow keys. thanks in advance.
-
- please email me at konrad@future.co.jp
-